//
// Created by Administrator on 2017/8/3.
//

#ifndef AUTOMAHJONG_MATCH_H
#define AUTOMAHJONG_MATCH_H

#include "Image.h"
#include "../utils/Prt.h"

using namespace utils;

namespace img {

    /**
     * 图像匹配类
     */
    class MatchImage {
    public:
        /**
         * 计算重合面积(像素)
         * @param src  图像1
         * @param dic  图像2
         * @return 重合面积(像素)
         */
        virtual uint32_t overlapArea(Prt<Image> &src, Prt<Image> &dic);

        /**
         * 基于网格的图像匹配
         * @param src  图像1
         * @param dic  图像2
         * @param gridCount 风格大小(取值 1- 8)
         * @param matching
         * @return
         */
        virtual uint64_t
        overlapGrid(Prt<Image> &src, Prt<Image> &dic, int gridCount, float matching);


        static Prt<MatchImage> &get();

        static void setInterface(const Prt<MatchImage> &mInterface);

    private:
        static Prt<MatchImage> mInterface;
    };

}

#endif //AUTOMAHJONG_MATCH_H
